package com.button.systemone.controller;

import com.button.domain.ResultData;
import com.button.domain.request.SystemOneRequest;
import com.button.domain.response.SystemOneResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统1测试接口
 * @author button
 * @Description 系统1测试接口
 * @create 2022/7/14
 */
@RestController
public class SystemOneController {

    /**
     * 系统1保存信息
     * @Description: 系统1保存信息
     * @author ZhangHang
     * @param systemOneRequest 系统1保存信息请求实体
     * @return com.button.domain.ResultData<com.button.domain.response.SystemOneResponse>
     * @date 2022/7/14 14:22
     */
    @PostMapping(value = "saveSysOneInfo")
    public ResultData<SystemOneResponse> saveSysOneInfo(@RequestBody SystemOneRequest systemOneRequest){
        SystemOneResponse systemOneResponse = SystemOneResponse.builder().name(systemOneRequest.getName()).addr(systemOneRequest.getAddr()).build();
        return ResultData.ok(systemOneResponse);
    }
}
